<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>水仙花案例</title>
  </head>
  <body>
    <script>
      for (var i = 100; i < 1000; i++) {
        // 个位表达式
        ge = i % 10;
        // 十位表达式
        shi = parseInt((i % 100) / 10);
        // 百位表达式
        bai = parseInt(i / 100);
        if (i == ge * ge * ge + shi * shi * shi + bai * bai * bai) {
          console.log(i);
        }
      }
    </script>
  </body>
</html>
